<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <script type="text/javascript" src="/static/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
  
    <link rel="stylesheet" type="text/css" href="/static/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/static/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/static/static/h-ui.admin/css/style.css" />
    <title>资讯列表</title>
</head>

<body>
    <div id="app">
        <nav class="breadcrumb">
            <i class="Hui-iconfont">&#xe67f;</i>
            首页
            <span class="c-gray en">&gt;</span>
            资讯管理
            <span class="c-gray en">&gt;</span>
            资讯列表
            <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
        </nav>
        <div class="page-container">
            <div class="text-c">
                <button onclick="removeIframe()" class="btn btn-primary radius">关闭选项卡</button>
                <span class="select-box inline">
                    <select name="" class="select">
                        <option value="0">全部分类</option>
                        <option value="1">分类一</option>
                        <option value="2">分类二</option>
                    </select>
                </span> 

                <input type="text" name="" id="" placeholder=" 资讯名称" style="width:250px" class="input-text">
                <button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i>
                    搜资讯</button>
            </div>
            <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><!-- <a href="javascript:;" onclick="datadel()"
                        class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
                    <a class="btn btn-primary radius" data-title="添加资讯" data-href="/static/view/admin_addview.html"
                        onclick="Hui_admin_tab(this)" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i>
                        添加资讯</a></span> -->
                <span class="r">共有数据：<strong>{[list.sum]}</strong> 条</span>
            </div>
            <div class="mt-20">
                <table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
                    <thead>
                        <tr class="text-c">
                            <th width="25"><input type="checkbox" name="" value=""></th>
                            <th width="80">ID</th>
                            <th>内容</th>
                            <th width="80">名称</th>
                            <th width="60">发布状态</th>
                            <th width="120">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="text-c" 
                            v-for="item in list.comment" :key="item.id">
                            <td><input type="checkbox" :value="item.id" name=""></td>
                            <td>{[item.id]}</td>
                            <td class="text-l"><u style="cursor:pointer" class="text-primary"  title="查看"></u>
                                {[item.body]}
                            </td>
                            <td>{[item.name]}</td>
                            <td class="td-status"><span class="label label-success radius">{[item.status==1?'已发布':item.status==2?'审核中':'已删除']}</span></td>
                            <td class="f-14 td-manage">
                                <a style="text-decoration:none" @click="xj(item.id)"
                                    href="javascript:;" title="下架">
                                    
                                    <i class="Hui-iconfont">&#xe6de;</i></a> <a style="text-decoration:none"
                                    class="ml-5"
                                    @click="tg(item.id)" title="通过"><i class="Hui-iconfont">&#xe6df;</i></a>
                               
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div id="pageNav" class="pageNav">

                <a @click="uppage">上一页</a>
                <a @click="nextpage">下一页</a>
            </div>
        </div>
    </div>
    <!--_footer 作为公共模版分离出去-->
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <script type="text/javascript">
        vm=new Vue({
            el: '#app',
            data: {
                list: {},
                page:1
            },
            methods: {
                xj(id) {
                    console.log("下回",id)
                    this.tj(id,0)
                },
                tg(id) {
                    console.log("cefp",id)
                    this.tj(id,1)
                },
                tj(id,status){
                    $.get("/admin/comment_verify?id="+id+"&status="+status, function (res) {
                        layer.msg("更新成功")
                            });
                },
                uppage(){
                    if(this.page<=1){
                       return layer.msg("没有上一页")
                    }
                    this.getpage(this.page-1)
                },
                nextpage(){
                    if(this.page*10>this.list.sum){
                       return layer.msg("没有下一页")
                    }
                    this.getpage(this.page+1)
                },
                getpage(page){
                    $.get("/admin/comment_list?page="+page, function (res) {
                    this.list = res.data
                                console.log("this", this.list)
                            });
                },
            }

        })
        $.get("/admin/comment_list", function (res) {
            vm.list = res.data
                        console.log( vm.list)
                    });
        /*资讯-删除*/
        /*  function article_del(obj, id) {
             layer.confirm('确认要删除吗？', function (index) {
                 $.ajax({
                     type: 'POST',
                     url: '',
                     dataType: 'json',
                     success: function (data) {
                         $(obj).parents("tr").remove();
                         layer.msg('已删除!', { icon: 1, time: 1000 });
                     },
                     error: function (data) {
                         console.log(data.msg);
                     },
                 });
             });
         } */


    </script>
    <!--/_footer 作为公共模版分离出去-->
    <!--请在下方写此页面业务相关的脚本-->
  

</body>

</html>